/*
 * Copyright (c) 2025 CAX Conversion Project
 */
package com.comac.ins.isfd.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.comac.ins.common.mybatis.core.page.TableDataInfo;
import com.comac.ins.common.web.core.BaseController;
import com.comac.ins.isfd.domain.bo.query.IsfdDatasourceTaskExecuteQueryBo;
import com.comac.ins.isfd.domain.bo.query.IsfdDatasourceTaskInstanceLogQueryBo;
import com.comac.ins.isfd.domain.vo.IsfdDatasourceTaskExecuteVo;
import com.comac.ins.isfd.domain.vo.IsfdDatasourceTaskInstanceLogVo;
import com.comac.ins.isfd.service.IIsfdDatasourceTaskInstanceLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据源数据集成-任务实例日志
 *
 * @author hxloongs
 * @date 2024-10-11
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/isfd/datasourceTaskInstanceLog")
public class IsfdDatasourceTaskInstanceLogController extends BaseController {
    @Autowired
    private IIsfdDatasourceTaskInstanceLogService isfdDatasourceTaskInstanceLogService;

    /**
     * 查询数据源数据集成任务实例日志列表
     */
    @SaCheckPermission("isfd:datasourceTaskInstanceLog:list")
    @PostMapping("/list")
    public TableDataInfo<IsfdDatasourceTaskInstanceLogVo> list(@RequestBody IsfdDatasourceTaskInstanceLogQueryBo queryBo) {
        return isfdDatasourceTaskInstanceLogService.queryPageList(queryBo);
    }


    /**
     * 任务监控列表接口
     */
    @SaCheckPermission("isfd:datasourceTaskInstanceLog:execute:list")
    @PostMapping("/execute/list")
    public TableDataInfo<IsfdDatasourceTaskExecuteVo> executeList(@RequestBody IsfdDatasourceTaskExecuteQueryBo queryBo) {
        return isfdDatasourceTaskInstanceLogService.executeList(queryBo);
    }

}
